const {contextBridge, ipcRenderer} = require("electron")
const url = require("url");

const sendUrl = async (url) => {
    //方式 on-url-event 事件到主进程
    return await ipcRenderer.invoke('on-url-event', url)
}

const alertDialog = (msg) => {
    ipcRenderer.invoke("on-alert-event", msg)
}


const openWidow = (url) => {
    ipcRenderer.invoke("on-open-event", url)
}

contextBridge.exposeInMainWorld('urlApi', {
    sendUrl,
    alertDialog,
    openWidow
})



